home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / python-apt / examples / sources.py < prev    next >
Encoding:
Python Source  |  2009-03-30  |  399 b   |  17 lines

  1. #!/usr/bin/python
  2.  
  3. import apt_pkg
  4.  
  5. apt_pkg.init()
  6.  
  7. #cache = apt_pkg.GetCache()
  8. #sources = apt_pkg.GetPkgSrcRecords(cache)
  9.  
  10. sources = apt_pkg.GetPkgSrcRecords()
  11. sources.Restart()
  12. while sources.Lookup('hello'):
  13.     print sources.Package, sources.Version, sources.Maintainer, \
  14.         sources.Section, `sources.Binaries`
  15.     print sources.Files
  16.     print sources.Index.ArchiveURI(sources.Files[0][2])
  17.